const idName = window.sessionStorage.getItem('idName')
console.log(idName)
const center = document.querySelector('.cart>.contain>.center')


getCart()
async function getCart() {
    let info = {
        itemId: `${idName}`,
    }
    const res = await pAjax({ url: '/nine', data: info, dataType: 'json' })
    console.log(res)
    bindImg(res.data.itemInfo.imgContent)
  
    bindInfo(res.data)
}

function bindImg(list) {
    str = ``
    list.forEach((item, index) => {
        str = `
      <input type="checkbox">
       <img src="${item}">
 `
        center.innerHTML = str
    })
}
function bindInfo(list) {
    // let str = ``
    str = `
     <p>${list.itemInfo.title}</p >
     <p>分类:${list.subItems[0].ctitle}</p >
     <p>￥${list.itemInfo.priceSale}</p >
     <div>
     <span>-</span>
     <span></span>
     <span>+</span>
     </div>
     <p>￥${list.itemInfo.priceSale}</p >
     <p>删除</p >
`
    center.innerHTML += str
}